<?php echo $form->create('Ketqua');?>
<table>
<tr><td><?php echo $form->input('lop',array('id'=>'lop','label'=>'Lớp','type'=>'select','options'=>$lops,'selected'=>$lop));?></td>
<td><?php echo $form->input('nienkhoa',array('id'=>'nk','label'=>'Niên khóa','type'=>'select','options'=>$namhoc,'selected'=>$nkdt));?></td></tr>
<tr><td><?php echo $form->input('hk',array('id'=>'hk','label'=>'Học kỳ','type'=>'select','options'=>$hk,'selected'=>$hkdt));?></td>
<td><?php echo $form->end('Xem');?></td><tr>
</table>
<?php
if(!empty($ketquas))
{
	echo $flashChart->begin();
	$flashChart->setTitle('Thống kê tỷ lệ học lực','{color:#000DFD;font-size:35px;padding-bottom:20px;}');
	$flashChart->setData($ketquas); 
    $flashChart->setNumbersPath( '{n}.Ketqua.sl' );
	$flashChart->setLabelsPath( 'default.{n}.Ketqua.ten' );
	$colors = array();
	foreach ($ketquas as $value)
	{
		// color function de trong controller Giaodichmuontra
		$col='#'.color();
		 while (in_array($col,$colors))
		{
			$col='#'.color();
		} 
		$colors[] =$col;
	}	
	echo $flashChart->chart('pie',array('colours'=>$colors));
	echo $flashChart->render(1000,500);        
}
else echo "<h2>Không có dữ liệu</h2>"; 
?>